import React, { useState } from 'react'
import Button from './Button'
import Image from './Image'

export default function StateUp() {
  let [str,setStr]=useState("http://api.xiaohigh.com/image/random")
  let chan=()=>{
    let str="http://api.xiaohigh.com/image/random?t="+Date.now()
    setStr(str)
  }
  return (
    <div>
      <Button chan={chan}/>
      <hr />
      <Image url={str}/>
    </div>
  )
}
